<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
        <title>直营店商品设置</title>
        <link rel="stylesheet" href="css/reset.css" />
        <link rel="stylesheet" href="css/platform.css" />
        <link rel="stylesheet" href="js/ui/jquery-ui.min.css" />
        <link rel="stylesheet" href="css/table.css" />
        <link rel="stylesheet" href="css/data-mssComm.css" />
        <!--<link rel="stylesheet" />-->
        <style>
            .export {
                text-align: right;
                margin-bottom: 10px;
            }
            .export .record-count {
                float: left;
            }
            .u-error {
                display: none;
            }
        </style>
    </head>

    <body>
         <div class="header">
            <div class="u-title">直营店商品设置</div>
        </div>
        <div class="main" ms-controller="mainController">
            <div class="u-multiform">
                <div class="column">
                    <div class="cell">
                        <label>商品搜索：</label>
                        <div class="cnt-box">
                            <input class="u-ipt" placeholder="请输入商品编码" maxlength="18" ms-duplex="commCode" />
                        </div>
                    </div>
                    <div class="cell">
                        <label>类型：</label>
                        <select ms-duplex="typeId">
                            <option value="">全部</option>
                            <option value="20">优选</option>
                            <option value="10">畅销</option>
                        </select>
                    </div>
                </div>
                <div class="column">
                    <div class="cell">
                        <label>品类： </label>
                        <div class="cnt-box">
                            <select ms-duplex="cateCode">
                                <option ms-repeat-cate="allCategory" ms-attr-value="cate.cateCode">{{cate.cateName}}</option>
                            </select>
                        </div>
                    </div>
                    <div class="cell">
	                    <label></label>
	                    <button class="u-btn small search" ms-click="searchRecordList">查询</button>
                    </div>
                </div>
            </div>
            <div class="u-title-tip"><span>商品列表</span>
                <span class="u-btn-self">
                    <button class="u-btn small" ms-click="importCommodity()">导入商品</button>
                    <button class="u-btn small" ms-click="addCommodity()">添加商品</button>
                </span>
            </div>
            <div id="taskTable" ms-controller="taskTable"></div>
            <script type="avalon" id="tableTask">
                <div class="tableWrapper">
                    <table class="table">
                        <thead>
                            <tr>
                                <th colspan="2">商品信息</th>
                                <th>类型</th>
                                <th>品类</th>
                                <th>商品编码</th>
                                <th>价格</th>
                                <th>日期</th>
                                <th>操作</th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr ms-repeat-row="sources">
                                <td class="table-row-pic"><img ms-attr-src="customFuncs.getUrl(row.commCode)"/></td>
                                <td class="table-row-name">{{customFuncs.processName(row.partName)}}</td>
                                <td>{{row.typeName}}</td>
                                <td>{{row.cateName}}</td>
                                <td>{{row.commCode}}</td>
                                <td><span id="price">{{row.price}}</span></td>
                                <td>{{row.beginDate}} - {{row.endDate}}</td>
                                <td><a href="javascript:;" ms-click="customFuncs.delCommodity(row)">删除</a></td>
                            </tr>
                        </tbody>
                        <tfoot>
                            <tr>
                                <td colspan="8">
                                    <div class="pager">
                                        <div class="first-page" ms-click="firstpage" ms-class={{firstpagestyle}}>首页</div>
                                        <div class="pre-page" ms-click="prepage" ms-class={{prepagestyle}}>上一页</div>
                                        <div class="current-page">
                                            第<input class="current-page-num" type="text" ms-duplex="currentpage" ms-input="jumppage" />页
                                            <span class="totalpage">共 {{totalpage}} 页</span>
                                        </div>
                                        <div class="next-page" ms-click="nextpage" ms-class={{nextpagestyle}}>下一页</div>
                                        <div class="last-page" ms-click="lastpage" ms-class={{lastpagestyle}}>尾页</div>
                                        <div class="messageinfo">{{startrow}}-{{endrow}} 共{{total}}条</div>
                                    </div>
                                </td>
                            </tr>
                        </tfoot>
                    </table>
                </div>
            </script>
        </div>
        
        <!--弹框区域-->
        <div ms-controller="popController">
	        <div class="u-popup" id="popup_tips">
                <div class="bg"></div>
                <div class="asTable">
                    <div class="asTableCell">
                        <div class="asCell alert">
                            <a href="javascript:;" class="close btn-close">×</a>
                            <p class="title">提示</p>
                            <div class="container">
                                <div class="error"></div>
                                <p></p>
                            </div>
                            <div class="btn-box">
                                <button class="u-btn btn-close">确定</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="u-popup" id="popup_confirm">
                <div class="bg"></div>
                <div class="asTable">
                    <div class="asTableCell">
                        <div class="asCell alert">
                            <a href="javascript:;" class="close btn-close">×</a>
                            <p class="title">提示</p>
                            <div class="container">
                                <div class="warning"></div>
                                <p>确定要删除该商品吗？</p>
                            </div>
                            <div class="btn-box">
                                <button class="u-btn" ms-click="confirmSure()">确定</button>
                                <button class="u-btn gray btn-close">取消</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="u-popup" id="popup_import">
                <div class="bg"></div>
                <div class="asTable">
                    <div class="asTableCell">
                        <div class="asCell alert import">
                            <a href="javascript:;" class="close btn-close">×</a>
                            <p class="title">选择导入文件</p>
                            <div class="container">
                                <form id="form_file" enctype="multipart/form-data" autocomplete="off" method="post">
                                    <input type="file" name="file" accept=".xls,.xlsx" id="upladFile" />
                                </form>
                            </div>
                            <div class="btn-box">
                                <button class="u-btn" ms-click="uploadFile">确定</button>
                                <button class="u-btn btn-close gray">取消</button>
                            </div>
                            <div id="load-import" class="loadData">
                                <div class="la-ball-spin-clockwise-fade">
                                    <div></div>
                                    <div></div>
                                    <div></div>
                                    <div></div>
                                    <div></div>
                                    <div></div>
                                    <div></div>
                                    <div></div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        
        <div class="loadData"></div>
        <script src="js/jquery.min.js"></script>
        <script src="js/avalon.shim.sn.js"></script>
        <script src="js/swift-ui-table-1.1.js"></script>
        <script src="js/platform.js"></script>
        <script src="js/jquery.form.js"></script>
        <script src="js/DataInterface/DataInterface.js"></script>
        <script src="js/ui/jquery-ui.min.js"></script>
        <script src="js/ui/jquery-ui-timepicker-addon.js"></script>
        <script src="js/mss-manage.js"></script>
    </body>
</html>
